
$(function(){

			adaptive();
			renderICkeck();
			$checkbox = $(".maintenance-ba").find("[type='checkbox']");
			var limitCond="";
			$checkbox.each(function(){
				if($(this).attr("checked")){
					limitCond+=$(this).parent().next().text()+",";
					
				}
			});
			var param={};
			param.projectId=projectId;
			param.limitCond=limitCond;
			pagination({total:parseInt($("#total").val()),size:parseInt($("#size").val()),currentpage:parseInt($("#page").val()),visibPage:3,pagePath:'maintplan'},param);
    		/*checkbox全选*/
		    var $checkboxAll = $(".maintenance-a").find("[type='checkbox']");
			$checkbox = $(".maintenance-ba").find("[type='checkbox']");
			length = $checkbox.length, i = 0;
			//全选checkbox
			$checkboxAll.on("ifClicked", function(event) {
				if (event.target.checked) {
					$checkbox.iCheck('uncheck');
					i = 0;
				} else {
					$checkbox.iCheck('check');
					i = length;
				}
			});
		
			//监听计数 
			
			$checkbox.on('ifClicked', function(event) {
				event.target.checked ? i-- : i++;
				if (i == length) {
					$checkboxAll.iCheck('check');
				} else {
					$checkboxAll.iCheck('uncheck');
				}
			});
			$("#maintPlanSearch").click(function(){
				$checkbox = $(".maintenance-ba").find("[type='checkbox']");
				var limitCond="";
				$checkbox.each(function(){
					if($(this).attr("checked")){
						limitCond+=$(this).parent().next().text()+",";
						
					}
				});
				var param={};
				param.projectId=projectId;
				param.limitCond=limitCond;
				$("#frameReft").load("maintplan", param);
			});

	    	});


function dmPostion(p){
	changeMain('ietm-home');
	top.dmIds=p;
	window.parent.clickDw(p);
//	window.parent.closeDailog();
	
}